﻿using Core.DataAccess.Model.Project.Queue;
using Core.Framework.EntityExtend;
using Core.Framework.EntityExtend.Model;
using Core.Framework.Util.Common;
using System;
using System.Linq;
using System.Threading;

namespace Core.ConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {

            using (var context = new ProjectSocketContext())
            {
                for (int i = 0; i < 20; i++)
                {
                    Thread.Sleep(1000);
                    Console.WriteLine(Watch.TimerByMilliseconds(() =>
                    {
                        context
                            .ProjectModuleUser
                            .UseCache(TimeSpan.FromSeconds(3),sliding:true)
                            .OrderBy(a => a.AliPayOpenid)
                            .Where(a => a.Id > 0)
                            .ToList(out bool isCache);

                        Console.WriteLine(isCache);

                    }));
                }
            }



            Console.ReadKey();
        }
    }
}
